import 'package:fate_blind_box/theme/theme_color.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class FateSuccessUi extends StatelessWidget {
  const FateSuccessUi({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const _FateSuccessWidget();
  }
}

class _FateSuccessWidget extends StatefulWidget {
  const _FateSuccessWidget({Key? key}) : super(key: key);

  @override
  State<_FateSuccessWidget> createState() => _FateSuccessState();
}

class _FateSuccessState extends State<_FateSuccessWidget> {
  late Size _screeSize;
  late double _screenWidth;
  late double _screeHeight;

  @override
  Widget build(BuildContext context) {
    _screeSize = MediaQuery.of(context).size;
    _screeHeight = _screeSize.height;
    _screenWidth = _screeSize.width;
    return Stack(
      children: [buildBackground(), buildBack(), buildContent()],
    );
  }
  /// 背景图
  Widget buildBackground() {
    return Image.network(
      "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201702%2F06%2F20170206212317_CKJz8.thumb.400_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1656770538&t=80a52931e7e68324e6ea9084cca2ea08",
      width: _screenWidth,
      height: _screeHeight,
      fit: BoxFit.cover,
    );
  }
  /// 返回键
  Widget buildBack() {
    return GestureDetector(
      onTap: () {
        Navigator.of(context).pop();
      },
      child: SizedBox(
        width: 56,
        height: 56,
        child: Icon(
          Icons.arrow_back_ios,
          color: ThemeColor.textColor,
          size: 24,
        ),
      ),
    );
  }
  /// 内容
  Widget buildContent() {
    return SizedBox(
      width: _screenWidth,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text(
            "牵手成功",
            style: TextStyle(
                color: ThemeColor.textColor,
                fontSize: 30,
                decoration: TextDecoration.none),
          ),
          Container(
            margin: const EdgeInsets.only(top: 12),
            child: Text(
              "恭喜你和 小燕子 互相牵手成功",
              style: TextStyle(color: ThemeColor.textColor, fontSize: 14, decoration: TextDecoration.none),
            ),
          ),
          Container(
            height: 150,
            width: 250,
            margin: const EdgeInsets.only(top: 60),
            child: Stack(
              children: [
                Align(
                  alignment: Alignment.centerLeft,
                  child: ClipOval(
                    child: Image.network(
                      "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2Fedpic%2F26%2F76%2Fc6%2F2676c60b8edf2e39782a48d52d414ab3.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1656770489&t=67c59f50fdee79fe4bcd35c11cbba299",
                      height: 150,
                      width: 150,
                      fit: BoxFit.cover,
                    ),
                  ),
                ),
                Align(
                  alignment: Alignment.centerRight,
                  child: ClipOval(
                    child: Image.network(
                      "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fup.enterdesk.com%2F2021%2Fedpic_source%2F8b%2Fd4%2Fbc%2F8bd4bc0d07d970efbe91b2f58d697f81_15.jpg&refer=http%3A%2F%2Fup.enterdesk.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1656770452&t=cc33ebda8b000041aa186254e7fc31c0",
                      height: 150,
                      width: 150,
                      fit: BoxFit.cover,
                    ),
                  ),
                )
              ],
            ),
          ),
          Container(
            margin: const EdgeInsets.only(top: 62),
            height: 40,
            width: 184,
            decoration: ShapeDecoration(
              shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
              color: Colors.white
            ),
            alignment: Alignment.center,
            child: GestureDetector(
              onTap: () {

              },
              child: Text(
                "快去聊聊",
                style: TextStyle(
                  color: ThemeColor.mainColor,
                  fontSize: 14
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
